package com.kitten.search.biz.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author kitten
 */
@Getter
@AllArgsConstructor
public enum NoteSortTypeEnum {

    // 最新
    LATEST(0),
    MOST_LIKE(1),
    MOST_COMMENT(2),
    MOST_COLLECT(3),
    ;


    private final Integer code;

    public static NoteSortTypeEnum valueOf(Integer code) {
        for (NoteSortTypeEnum type : NoteSortTypeEnum.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }

}
